home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / recovcmd / RCS / recovcmd.c,v < prev   
Encoding:
Text File  |  1990-05-31  |  3.4 KB  |  158 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     90.04.18.20.18.06;  author mgbaker;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     90.04.18.17.22.43;  author mgbaker;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     90.04.18.16.38.35;  author mgbaker;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @Original version.
  27. @
  28.  
  29.  
  30. 1.3
  31. log
  32. @took out print statement
  33. @
  34. text
  35. @/* 
  36.  * recovcmd.c --
  37.  *
  38.  *    User interface to recovery related commands.
  39.  *
  40.  * Copyright (C) 1986 Regents of the University of California
  41.  * All rights reserved.
  42.  * Permission to use, copy, modify, and distribute this
  43.  * software and its documentation for any purpose and without
  44.  * fee is hereby granted, provided that the above copyright
  45.  * notice appear in all copies.  The University of California
  46.  * makes no representations about the suitability of this
  47.  * software for any purpose.  It is provided "as is" without
  48.  * express or implied warranty.
  49.  */
  50.  
  51. #ifndef lint
  52. static char rcsid[] = "$Header: /sprite/src/cmds/recovcmd/RCS/recovcmd.c,v 1.2 90/04/18 17:22:43 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)";
  53. #endif not lint
  54.  
  55. #include "sprite.h"
  56. #include "status.h"
  57. #include "option.h"
  58. #include "stdio.h"
  59. #include "sysStats.h"
  60.  
  61. /*
  62.  * Command line options.
  63.  */
  64.  
  65. int    recovAbsolutePings = -1;
  66. int    recovStats = -1;
  67. int    printLevel = -1;
  68.  
  69. Option optionArray[] = {
  70.     {OPT_TRUE, "abson", (Address) &recovAbsolutePings, 
  71.     "\tMake recovery ping interval absolute."},
  72.     {OPT_FALSE, "absoff", (Address) &recovAbsolutePings, 
  73.     "\tMake recovery ping interval relative to when it finishes pinging."},
  74.     {OPT_TRUE, "recovStats", (Address) &recovStats, 
  75.     "\tPrint out recovery statistics."},
  76.     {OPT_INT, "printLevel", (Address) &printLevel, 
  77.     "\tSet recov trace print level (0=off, 1=default, 10=highest)."},
  78. };
  79. int numOptions = sizeof(optionArray) / sizeof(Option);
  80.  
  81.  
  82. /*
  83.  *----------------------------------------------------------------------
  84.  *
  85.  * main --
  86.  *
  87.  *    Collects arguments and branches to the code for the command.
  88.  *
  89.  * Results:
  90.  *    None.
  91.  *
  92.  * Side effects:
  93.  *    Calls the command.
  94.  *
  95.  *----------------------------------------------------------------------
  96.  */
  97. main(argc, argv)
  98.     int argc;
  99.     char *argv[];
  100. {
  101.     register ReturnStatus status = SUCCESS;    /* status of system calls */
  102.  
  103.     argc = Opt_Parse(argc, argv, optionArray, numOptions);
  104.  
  105.     /*
  106.      * Set various recov system flags.
  107.      */
  108.     if (recovAbsolutePings != -1) {
  109.     status = Sys_Stats(SYS_RECOV_ABS_PINGS, recovAbsolutePings, NIL);
  110.     }
  111.     if (printLevel != -1) {
  112.     status = Sys_Stats(SYS_RECOV_PRINT, printLevel, NIL);
  113.     }
  114. #ifdef NOTDEF
  115.     if (recovStats != -1) {
  116.     Recov_Stats    stats;
  117.  
  118.     status = Sys_Stats(SYS_RECOV_STATS, sizeof (Recov_Stats), &stats)
  119.     if (status != SUCCESS) {
  120.         fprintf(stderr, "Recov stats failed: error %x.\n", status)
  121.     } else {
  122.         fprintf(stderr,
  123.             "Haven't figured out what to do about this option yet.\n");
  124.     }
  125.     }
  126. #endif NOTDEF
  127.     exit(status);
  128. }
  129. @
  130.  
  131.  
  132. 1.2
  133. log
  134. @Added more hooks
  135. @
  136. text
  137. @d18 1
  138. a18 1
  139. static char rcsid[] = "$Header: /sprite/src/cmds/recovcmd/RCS/recovcmd.c,v 1.1 90/04/18 16:38:35 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)";
  140. a77 1
  141.     printf("printLevel is %d\n", printLevel);
  142. @
  143.  
  144.  
  145. 1.1
  146. log
  147. @Initial revision
  148. @
  149. text
  150. @d18 1
  151. a18 1
  152. static char rcsid[] = "$Header: /sprite/src/cmds/rpccmd/RCS/rpccmd.c,v 1.3 89/08/15 21:11:45 jhh Exp Locker: mgbaker $ SPRITE (Berkeley)";
  153. d33 1
  154. d42 2
  155. d77 5
  156. d93 1
  157. @
  158.